""""
常用功能：
1.发布话题
"""
import requests

def test_create_topic(post_data):
    """
    创建主题
    :return:
    """
    create_url = 'http://49.233.108.117:3000/api/v1/topics'
    post_data = {"accesstoken":'e303f3c0-41e3-4dec-a44f-beb6ff281e6a',
                 "title":"helloworld",
                 "tab":"ask",
                 "content":"xxxxxxxxxx"}
    res = requests.post(url=create_url,data=post_data)
    topic_id=res.json()['topic_id']
    return topic_id

def get_topic_detail(topic_id):
    url = "http://49.233.108.117:3000/api/v1/topic/" + topic_id
    res = requests.get(url)
    return res

def get_token():
    """
    获取最新的token值
    :return:
    """
    return 'e303f3c0-41e3-4dec-a44f-beb6ff281e6a'

def get_url():
    """
    获取最新token值
    :return:
    """
    return 'http://49.233.108.117:3000/api/v1/topic'
